import re

username = 'abcdefghijklmnop'
m1 = re.match(r'^[a-zA-Z0-9_]{6,20}$', username)
if not m1:
    print('invalid username')

qq = '123456789000'
m2 = re.match(r'^[1-9]\d{4,11}$', qq)
if not m2:
    print('invalid qq')

sentence = '你丫是傻叉吗? 我操你大爷的. Fuck you.'
purified = re.sub('[操肏艹]|fuck|shit|傻[比屄逼叉缺吊屌]|煞笔', '*', sentence, flags=re.IGNORECASE)
print(purified)  # 你丫是*吗? 我*你大爷的. * you.

poem = '窗前明月光，疑是地上霜。举头望明月，低头思故乡。'
sentence_list = re.split(r'[,.，。]', poem)
print(sentence_list)